A visual sensor requires that its attitude be controlled so that the sensor can continue to detect objects, in all positions between two points, namely, a starting point and an end point on a moving path of a tool attached to a robot, when the robot moves the tool. For example, a visual sensor for a welding robot has its attitude controlled so that the sensor can continue to detect the positions of the objects to be welded together, prior to the movement of a welding torch attached to the robot.
In prior art, attitude control methods of a visual sensor utilized for an industrial robot have generally comprised the steps of dividing into a plurality of sections a tool path which lies between two points, namely a starting point and an end point, of the tool attached to the robot when the robot moves the tool; manually adjusting the attitude of the visual sensor when the tool is on each point between the divided adjacent sections in advance so that the sensor can accurately detect the objects; teaching the attitude representing data determined by the manual adjustment step; and controlling the attitude of the sensor when the tool is on each of the plurality of points between the two points in accordance with the attitude data taught in advance.
The attitude control methods of a visual sensor utilized for an industrial robot according to the prior art present no problem if the path between two points is a direct line because the necessary teaching points are merely two, therefore it does not require time and labor. However, if the path is a curve, there is the problem of the time and labor required to teach the attitude of the sensor so that the sensor can keep detecting the objects within the range of its sight at a large number of points when the tool moves between the two points. Furthermore, according to the prior art, it is possible to optimize the attitude at the taught points so that the sensor passes through the points, however, the attitude in between the taught points cannot be optimum. Therefore, the measuring accuracy for detecting positions of the objects by the visual sensor is only good at each of the taught points, but is not continually good in between the taught points.